<!DOCTYPE html>
<head>
    <#assign dicSelect = JspTaglibs["http://www.casic304.cn/dicSelect"]/>
    <#assign secSelect = JspTaglibs["http://www.casic304.cn/secSelect"] />
    <meta charset="utf-8">
    <title>获奖管理基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <#if isClose == 'true'>
    <style>
        .listBody .qbdms-bodyDiv{padding: 0 ;background: #fff}
        body.qbdms-particulars .qbdms-bodyDiv div.layui-table-view-body{padding: 16px}
        .layui-form-select .layui-input{padding-right: 0}
    </style>
</#if>
</head>
<body class="listBody qbdms-particulars">
<div class="qbdms-bodyDiv">
    <div class="layui-table-view-body qbdms-add-view-body">
        <#if isClose != 'true'> <div class="qbdms-formTitle">获奖信息 <i class="qbdms-returnOn closeWindow">返回</i></div></#if>
        <form class="formPreview layui-form" requrl="${ctx}/qbdms/wQbdAwardInformation/get" lay-filter="wQbdAwardInformationDataForm">
            <div class="" style="width: 100%;overflow-x: auto">
                <table class="tableExcel qbdms-zeroTable" width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                        <tr id="tbxx"></tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">个人/单位<span style="color: red;">*</span></td>
                            <td name="awardOrg"></td>
                            <td class="qbdms-zeroTable-lable">获奖单位</td>
                            <td name="awardDept"></td>
                            <td class="qbdms-zeroTable-lable">获奖人</td>
                            <td name="awardPerson"></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">密级<span style="color: red;">*</span></td>
                            <td><@secSelect.sec_select data_src=1 required=true name="secret"/></td>
                            <td class="qbdms-zeroTable-lable">工作单位</td>
                            <td name="workDept"></td>
                            <td class="qbdms-zeroTable-lable">获奖名称<span style="color: red;">*</span></td>
                            <td name="awardName"></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">奖项类别<span style="color: red;">*</span></td>
                            <td><@dicSelect.dic name="awardType" nodeKey="jxlb"/></td>
                            <td class="qbdms-zeroTable-lable">年度<span style="color: red;">*</span></td>
                            <td name="years"></td>
                            <td class="qbdms-zeroTable-lable">获奖时间<span style="color: red;">*</span></td>
                            <td name="awardDate"></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">获奖等级<span style="color: red;">*</span></td>
                            <td name="awardGrade"></td>
                            <td class="qbdms-zeroTable-lable">授奖单位<span style="color: red;">*</span></td>
                            <td name="grantDept"></td>
                            <td class="qbdms-zeroTable-lable">评定阶段<span style="color: red;">*</span></td>
                            <td><@dicSelect.dic name="stage" nodeKey="pdjd" verify="required" reqtext="评定阶段是必选项"/></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">证书编号<span style="color: red;">*</span></td>
                            <td name="certificateNo" colspan="5"></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">获奖原因</td>
                            <td name="awardReason" colspan="5"></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">奖励金额（元）</td>
                            <td name="awardAmount" colspan="5"></td>
                        </tr>
                        <tr>
                            <td class="qbdms-zeroTable-lable">相关证明文件</td>
                            <td colspan="5">
                                <div class="uploadFileList" fileUploadName="certificateFile"></div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <input type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" name="awardDate" format="yyyy-MM-dd" datetype="date" lay-verify="required" lay-reqtext="获奖时间是必选项">
            </div>
            <#if isClose != 'true'>
                <div class="layui-form-item btnformItem">
                    <p>
                        <button type="reset" id="closeWindow" class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">返回</button>
                    </p>
                </div>
            </#if>

            <!--<div class="qbdms-formBody">
                <div id="tbxx"></div>
                <div class="layui-row">
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="个人/单位">个人/单位<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="awardOrg" nodeKey="grdw" verify="required" reqtext="个人/单位是必选项" filter="awardOrg"/>
                        </div>
                    </div>
                    <div class="qbdms-oneForm" id="awardDeptTd">
                        <label class="layui-form-label qbdms-label" title="获奖单位">获奖单位</label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="未填写" autocomplete="off" class="layui-input " name="awardDept" maxlength="50" readonly>
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="获奖人">获奖人</label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="未填写" autocomplete="off" class="layui-input textInput" name="awardPerson" maxlength="50" readonly>
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="密级">密级<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@secSelect.sec_select data_src=1 required=true name="secret"/>
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="工作单位">工作单位</label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="未填写" autocomplete="off" class="layui-input " name="workDept" maxlength="50" readonly>
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="获奖名称">获奖名称<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="未填写" autocomplete="off" class="layui-input " lay-verify="required" name="awardName" lay-reqtext="获奖名称是必填项" maxlength="50">
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="奖项类别">奖项类别<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="awardType" nodeKey="jxlb" verify="required" reqtext="奖项类别是必选项"/>
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="年度">年度<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="未填写" class="layui-input " lay-verify="required" name="years" id="years" lay-reqtext="年度是必填项" maxlength="50">
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="获奖时间">获奖时间<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" name="awardDate" format="yyyy-MM-dd" datetype="date" lay-verify="required" lay-reqtext="获奖时间是必选项">
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="获奖等级">获奖等级<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="awardGrade" placeholder="未填写" autocomplete="off" class="layui-input  textInput" maxlength="50" lay-verify="required" lay-reqtext="获奖等级是必填项">
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="授奖单位">授奖单位<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="grantDept" nodeKey="sjdw" verify="required" reqtext="授奖单位是必选项"/>
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="评定阶段">评定阶段<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="stage" nodeKey="pdjd" verify="required" reqtext="评定阶段是必选项"/>
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="证书编号">证书编号<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="未填写" autocomplete="off" class="layui-input " lay-verify="required" name="certificateNo" lay-reqtext="证书编号是必填项" maxlength="50">
                        </div>
                    </div>
                    <div class="qbdms-textarea">
                        <label class="layui-form-label qbdms-label" title="获奖原因">获奖原因</label>
                        <div class="layui-input-block qbdms-input">
                            <textarea rows="2" class="layui-textarea" placeholder="未填写" name="awardReason" maxlength="50"></textarea>
                        </div>
                    </div>
                    <div class="qbdms-oneForm">
                        <label class="layui-form-label qbdms-label" title="奖励金额">奖励金额（元）</label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="未填写" autocomplete="off" class="layui-input " lay-verify="money" name="awardAmount" maxlength="10">
                        </div>
                    </div>
                    <div class="qbdms-textarea">
                        <label class="layui-form-label qbdms-label">相关证明文件</label>
                        <div class="layui-input-block qbdms-input">
                            <div class="doNotDelThisDiv layui-input-inline">
                                <div class="uploadFileCont">
                                    <button type="button" class="layui-btn fileUpload qbdms-fileUp iconfont iconupload"> 上传附件</button>
                                    <i class="qbdms-fileUpText">支持单个附件上传，附件格式：doc docx pdf，文件大小限制不超过200M</i>
                                    <input type="text" id="certificateFile" class="uploadInput" name="certificateFile" style="display: none">
                                    <div class="uploadFileList" fileUploadName="certificateFile"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>-->
        </form>
    </div>
</div>

<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'setter', 'layer', 'propsHandle', 'upload', 'common', 'laydate', 'jquery', 'publicMethods', 'commonDialog', 'qbdmsForm'], function () {

        // -----常量声明----------
        var $ = layui.jquery,
            laydate = layui.laydate,
            setter = layui.setter,  // 配置信息
            layer = layui.layer,
            common = layui.common,
            propsHandle = layui.propsHandle,
            upload = layui.upload,
            publicMethods = layui.publicMethods,
            formId = '${formDefId}' || '',
            commonDialog = layui.commonDialog,
            defProps = {
                //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
                viewMould: 'moulds/', // 组件模块 存放文件 *****
                formAreaInfo: '.formPreview',
                formAreaInfo: 'html',
                temDate: '.temDate',
                uploadFileBtn: '.uploadFileBtn',
                uploadImgBtn: '.uploadImgBtn',
                richTextArea: '.richTextArea',
                selectInput: '.selectInput',
                radioOptionCont: '.radioOptionCont',
                dataLexiTree: '.dataLexiTree',
                selectorBtn: '.selectorBtn'
            },
            form = layui.qbdmsForm;
        var defProps = {
                //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
                viewMould: 'moulds/', // 组件模块 存放文件 *****
                initCss: [
                    // 'style/forms/formDevise',
                    // 'style/forms/dragLay',
                    // 'style/forms/formPreview'
                ],// formAreaInfo:'.formPreview',
                formAreaInfo: 'html',
                temDate: '.temDate',
                uploadFileBtn: '.uploadFileBtn',
                uploadImgBtn: '.uploadImgBtn',
                richTextArea: '.richTextArea',
                selectInput: '.selectInput',
                radioOptionCont: '.radioOptionCont',
                dataLexiTree: '.dataLexiTree',
                selectorBtn: '.selectorBtn'
            },
            temQuery = new propsHandle()  // 实例化模板功能部分
        ;


        // 初始化模板功能
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });
        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdAwardInformation/view/list';
        });

        common.updateForm({
            name: 'wQbdAwardInformationDataForm',
            idValue: "${id}",
            primary: "id",
            getCallback: function (data) {
                // 注：奖励金额（元）是数字类型，非必填，不填的时候保存的是null，明细页面就显示“null”，这里手动转换为空字符串
                if (data.data.awardAmount == null) {
                    data.data.awardAmount = "";
                }
                $("#tbxx").html("<td class='qbdms-zeroTable-lable'>填报信息:</td><td colspan='5' class=''>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</td>");
                // $("#tbxx").html("<span class='qbdms-TBinformation'>填报信息:</span><span class='qbdms-TBinformationText'>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</span>");
                //-修改页面 初始化附件组件 开始 ------------------------------------------
                $('.uploadFileList').each(function () {
                    var fileUploadName = $(this).attr("fileUploadName");
                    var jsonFile = data.data[fileUploadName];
                    var files = eval(jsonFile);

                    if (files) {
                        for (var i = 0; i < files.length; i++) {
                            var fileLevel = files[i].fileLevel;
                            var fileLevelText = files[i].fileLevelText;
                            var fileSec = '<div class="fileSecLevel fileSecXg layui-input-inline">' + '<@secSelect.sec_select data_src=1 hasBlank=false/>' + "</div>";
                            var newStr = '<span class="file-id" style="margin-right: 20px;" fileId=' + files[i].fileId + ' fileLevelText="' + fileLevelText + '">' + fileSec + '<span class="file-name" title="点击下载文件" onclick="downFile(this)"><i class="iconfont" style="margin-right: 5px"></i>' + files[i].fileName + '</span></span>';
                            $(this).append(newStr);
                            $(this).find("select:last").val(fileLevel);
                            $(this).find("select:last").attr("disabled", "disabled");
                        }
                    } else {
                        $(this).html("<span style='color: #c0c4cc'>未上传</span>");
                        /*$(".uploadFileCont").each(function () {
                            if ($(this).children('.uploadFileList').children().length == 0) {
                                $(this).children('.uploadFileList').append("<span style='color: #C0C4CC'>未上传</span>")
                            }
                        })*/
                    }
                });
                //-修改页面 初始化附件组件 结束 ------------------------------------------
            }
        });

        //下载附件
        window.downFile = function (obj) {
            var fileId = $(obj).parents("span").attr("fileId");
            window.location.href = serverPath.qbdmsPath + setter.extendLinkPath + "attachFile/download?fileId=" + fileId;
        }

        publicMethods.bottomFixd()
        $("body *").not("#closeWindow").attr("disabled", "disabled");
        $(".uploadFileCont .qbdms-fileUp,.uploadFileCont i,.addFormTr1").hide();
        /*$(".uploadFileCont").each(function () {
            if ($(this).children('.uploadFileList').children().length == 0) {
                $(this).children('.uploadFileList').append("<span style='color: #C0C4CC'>未上传</span>")
            }
        })*/
    });
</script>
</body>
</html>